<form method="post" class="saveTable" id="tableForm_<?= $this->tableId ?>_Project_<?= $this->projectId ?>" action="javascript:void(0);">
	<fieldset class="tableMenu">
		<div>
			<input type="submit" name="salvar" id="saveTable_<?= $this->tableId ?>_Project_<?= $this->projectId ?>" value="Salvar"/>
		</div>
		<div>
			<a href="javascript:void(0);" id="drop_table_<?= $this->tableId ?>_<?= $this->projectId?>" class="dropTable">Excluir</a>
		</div>
	</fieldset>
	<fieldset class="tableHeader">
	
	<?php 

		//lista as colunas
		foreach($this->table['schema'] as $collumnId => $collumnHeader)
		{
			if($collumnHeader['Field'] != 'id')
			{
	?>
		<div class="collumn"> 
			<input type="text" name="<?= $collumnHeader['Field']?>-0-alter" value="<?= $collumnHeader['Field'] ?>"/>
		</div>
		<div>
				<select name="<?= $collumnHeader['Field']?>-0-alter-type">
					<option value="string">Texto</option>
					<option value="int">Inteiro</option>
				</select>
		</div>
		<div>
			<a href="javascript:void(0)" class="columnRemove" id="collumnRemove_<?= $collumnHeader['Field']?>_<?= $this->tableId ?>_<?= $this->projectId?>">Remover</a>
		</div>	
	<?php 
			}
		}
	?>
		<div class="newCollumnMenu disabled">
			<input type="hidden" name="tableInfo" value="project_<?= $this->projectId ?>_table_<?= $this->tableId ?>"/>
			<div>
				<label for="newCollumnName">Nome: </label>
				<input type="text" name="newCollumnName"/>
			</div>
			<div>
				<select name="newCollumnType">
					<option value="string">Texto</option>
					<option value="int">Inteiro</option>
				</select>
			</div>
			<div>
				<input type="button" name="applyNewCollumn" value="Aplicar"/>
			</div>
		</div>

		<span id="collumCreator">
			<a href="#" class="addCollumn">+</a>
		</span>
	</fieldset>

	<fieldset class="tableBody">	
		<div class="row">
	<?php
			//dbg($this->table['schema']);die;

			foreach($this->table['schema'] as  $collumnBlank)
			{
				if($collumnBlank['Field'] != 'id')
				{
	?>		
			<div class="collumn"><input type="text" name="<?= $collumnBlank['Field'] ?>-n-insert" value=""/></div>
	<?php
				}
			}
	?>

		</div>

	<?php 
		//lista as linhas
		foreach($this->table['content'] as $rows)
		{
	?>
		<div class="row">
	<?php
			$counter = 0;
			foreach($rows as $collumnName => $collumnValue)
			{
				$collumn = $this->table['schema'][$counter]['Field'];

				if($collumnName == 'id')
				{
					$id = $collumnValue;
				}
				else
				{
	?>		
			<div class="collumn">
				<input type="text" name="<?= $collumn ?>-<?= $id ?>-update" value="<?= $collumnValue ?>"/>
			</div>
	<?php
				}
			$counter++;
			}
	?>

		</div>
	<?php
		}
	?>
	
	</fieldset>
</form>